package com.lwc.mapper;

import com.lwc.bean.EnterpriseCategory;
import com.lwc.bean.EnterpriseTree;
import com.lwc.common.crud.IMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface EnterpriseCategoryMapper extends IMapper<EnterpriseCategory> {

    /**
     * 根据类别编码增加企业数量
     * @param code
     * @return
     */
    int addEnterpriseNum(String code);


    //根据父类别ID 查询类别编码
     String getMaxCodeById(int id);

     //根据id查编码
  String getCodeById(int id);
//根据id 判断数据库中是否有子类

    int getistureByid(int id);

    int update (@Param(value = "id") int id,@Param(value = "name") String name,@Param(value = "status") int status);

    List<EnterpriseCategory> querylist();

    List<EnterpriseCategory>query();

    /**
     * 类别数
     * @return
     */
    List<EnterpriseTree>tree(int parentId);

}
